VT-d: skip IOMMU bitmap cleanup for phantom devices
authorJan Beulich <jbeulich@suse.com>
Thu, 16 Sep 2021 09:02:48 +0000 (11:02 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 16 Sep 2021 09:02:48 +0000 (11:02 +0200)
Doing the cleanup also for phantom devices is at best redundant with
doing it for the corresponding real device. I couldn't force myself into
checking all the code paths whether it really is: It seems better to
explicitly skip this step in such cases.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/iommu.c

index 9827ab184d606a297aba48116cc937e55c28970e..aeb1dddc8804a8e5efc8de2ed839926de0662066 100644 (file)
@@ -1733,7 +1733,7 @@ static int domain_context_unmap(struct domain *domain, u8 devfn,
         return -EINVAL;
     }
 
-    if ( ret || QUARANTINE_SKIP(domain) )
+    if ( ret || QUARANTINE_SKIP(domain) || pdev->devfn != devfn )
         return ret;
 
     /*